package com.syh.jn.scm.domain.supplier.repository.stock;

import cn.redscarf.commons.wrapper.Wrapper;
import com.syh.core.ddd.infrastructure.repository.CreateRepo;
import com.syh.core.ddd.infrastructure.repository.DeleteRepo;
import com.syh.core.ddd.infrastructure.repository.UpdateRepo;
import com.syh.jn.scm.domain.supplier.entity.stock.StockOtherOutBill;
import com.syh.jn.scm.domain.supplier.entity.stock.StockOtherOutBillItem;

import java.util.List;

/**
 * 其他出入库
 */
public interface StockOtherOutBillRepository extends StockOtherOutBillReadRepository, CreateRepo<StockOtherOutBill,Long>, UpdateRepo<StockOtherOutBill, Long>, DeleteRepo<StockOtherOutBill,Long> {

  /**
   * 重载update,选择是否更新item
   * @param stockOtherOutBill 其他出库单
   * @param isUpdateItem 是否更新订单项
   */
  void update(StockOtherOutBill stockOtherOutBill, boolean isUpdateItem);


  /**
   * 查找出入库单项
   * @param wrapper
   * @param startRow
   * @param count
   * @return
   */
  List<StockOtherOutBillItem> findStockOtherOutBillItemListPage(Wrapper wrapper, Integer startRow, Integer count);

  /**
   * 查找出入库单项数量
   * @param wrapper
   * @return
   */
  int  findStockOtherOutBillItemListPageCount(Wrapper wrapper);

  /**
   * 根据服务商id删除其他出库单
   * @param businessEntityId
   */
  void deleteByBusinessEntityId(Long businessEntityId);
}
